<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>会员注册</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/qdh.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/member.css" type="text/css" media="screen" />
<script src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidator.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/common/js/formvalidatorregex.js"></script>
<script type="text/javascript">
$(function(){

	$.formValidator.initConfig({formid:"regForm",autotip:true});
		$("#name").formValidator({onshow:"请输入用户名",onfocus:"用户名应该为2-20位之间"}).inputValidator({min:2,max:20,onerror:"用户名应该为2-20位之间"}).regexValidator({regexp:"notempty",datatype:"enum",onerror:"请输入用户名"})
		.ajaxValidator({
		datatype : "json",
		async : false,
		type:"post",
		url : "${pageContext.request.contextPath}/view/member/checkUser.action",
		success : function(data){
			if(data.success) return true;
	        return false;
		},
		onerror : "该用户名已存在，请更换",
		onWait : "正在验证用户名，请稍候..."
		});
	$("#password").formValidator({onshow:"请输入密码",onfocus:"密码应该为6-20位之间"}).inputValidator({min:6,max:20,onerror:"密码应该为6-20位之间"});
	$("#repassword").formValidator({onshow:"请输入确认密码",onfocus:"请输入确认密码",oncorrect:"密码输入一致"}).compareValidator({desid:"password",operateor:"=",onerror:"密码不同"});
	$("#email").formValidator({onshow:"请输入E-mail",onfocus:"请输入E-mail",oncorrect:"E-mail格式正确"}).regexValidator({regexp:"email",datatype:"enum",onerror:"E-mail格式错误"})
	});

</script>
</head>
<body>
<div id="wrap">
	<s:include value="header.jsp"/>
	<div id="container">
		<div class="memberbox">
			<h1>用户注册</h1>
			<div class="fl loginbox">
				<form id="regForm" action="regUser.action">
					<ul class="loginform" style="margin-top:10px;">
						<li><span>用户名</span><input type="text" id="name" name="name" class="logintxt" /></li>
						<li><span>密&nbsp;&nbsp;&nbsp;码</span><input type="password" id="password" name="password" class="logintxt" /></li>
						<li><span>确认密码</span><input type="password" id="repassword" class="logintxt" /></li>
						<li><span>邮&nbsp;&nbsp;&nbsp;箱</span><input type="text" id="email"  name="email" class="logintxt" /></li>
						<li><span>&nbsp;</span><input type="submit"   class="regbtn" value="注册"/></li>
					</ul>
				</form>
			</div>
			<div class="fr reginfo">
				<h2>我已经注册，现在就登录</h2>
				<p style="padding-bottom:10px;"><a href="${pageContext.request.contextPath}/view/member/login.jsp" title="马上登陆"><img src="${pageContext.request.contextPath}/common/image/mlogin.jpg" alt="马上登陆"/></a></p>
				
			</div>
		</div>
		<div class="clr"></div>
	</div>
    <div class="mt15"></div>
	<s:include value="../footer.htm"/>
</div>
</body>
</html>
